/* $Id$ */
package org.crazydays.gameplan.db.event;


import java.awt.event.ActionEvent;

import org.crazydays.gameplan.Controller;
import org.crazydays.gameplan.swing.AbstractActionWrapper;
import org.crazydays.gameplan.util.IconHelper;
import org.crazydays.i18n.Messages;

/**
 * CloseDatabase
 */
public class CloseDatabase
    extends AbstractActionWrapper
{
    /** serial version uid */
    public final static long serialVersionUID =
        "$Id: SaveAction.java 35 2009-05-06 19:05:18Z aaron.day $".hashCode();

    /** messages */
    public final static Messages MESSAGES = Messages.getInstance();

    /** resource key: name */
    public final static String RESKEY_NAME = "action.CloseDatabase.name";

    /** resource key: icon */
    public final static String RESKEY_ICON = "action.CloseDatabase.icon";

    /**
     * CloseDatabase constructor.
     * 
     * @param controller Controller
     */
    public CloseDatabase(Controller controller)
    {
        super(MESSAGES.getMessage(RESKEY_NAME), IconHelper.loadIcon(MESSAGES
            .getMessage(RESKEY_ICON)), controller);
    }

    /**
     * Close open database.
     * 
     * @param event Event
     * @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
     */
    public void actionPerformed(ActionEvent event)
    {
        controller.closeDatabase();
    }
}
